package com.tte.common.controller;

import com.github.pagehelper.PageInfo;
import com.tte.common.service.DictionaryService;
import com.tte.common.model.tenum.ResultCode;
import com.tte.common.model.vo.PageVo;
import com.tte.common.model.vo.ResultBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ViewController
 * @Author: DongWH
 */
@RestController
@RequestMapping("/dictionary")
public class DictionaryController {
    @Autowired
    private DictionaryService dictionaryService;

    @RequestMapping("/query")
    public ResultBean test(@RequestBody PageVo page){
        PageInfo pageInfo = dictionaryService.selectAll(page.getPageNum(),page.getPageSize());
        return new ResultBean(ResultCode.OK,pageInfo);
    }
}
